package com.probiz.estore.customer.dao.impl;

import java.util.List;

import com.probiz.estore.common.model.customer.ReviewEligibility;
import com.probiz.estore.core.dao.impl.HibernateGenericDaoImpl;
import com.probiz.estore.customer.dao.ReviewEligibilityDao;

/**
 * Dao implementation for ReviewEligibility.
*/
public class ReviewEligibilityDaoImpl extends HibernateGenericDaoImpl<ReviewEligibility> implements ReviewEligibilityDao {
		
	
	/*
	 * (non-Javadoc)
	 * @see com.probiz.estore.customer.dao.ReviewEligibilityDao#getReviewEligibilityByPCustomerIdAndProductId(java.lang.Integer, java.lang.Integer)
	 */
	public ReviewEligibility getReviewEligibilityByPCustomerIdAndProductId(Integer customerId,Integer productId){
		List<ReviewEligibility> list = this.findByHql("from ReviewEligibility re where customer.appuserId=? and product.productId = ? ", customerId,productId);
		if(list.size()>0){
			return list.get(0);
		}else{
			return null;
		}
	}
}
